Repository navigation
D3D12-GPU-SHOWN-SAVER-EVENT-DROP: close shown saver event handle on drop - #3003
bobcatchris wants to merge 1 commit into
Conversation
|
Verified both exits through saver() at 679938d on native Windows. A temporary crate test used a real D3D12 device, warmed each path once, then measured the process handle count with GetProcessHandleCount across 64 calls. The parent saver function and the PR saver ran in the same isolated test process.
This reproduces one leaked handle per invocation on the parent and verifies both cleanup paths on the PR. No frame capture or fence completion was exercised. Codex-assisted. |
|
Both actual saver exits release the event under Wine, including with the replay handle fix applied. I cross-built Win64 with On both RTX 4070 SUPER (620.73.04) and Radeon Raphael (RADV 26.3.1), I ran eight calls per GPU per exit path. For a closed queue and for a queued synthetic job with the sender still open and |
Addresses claim in #2570 (comment).
Cause
shown::saver(d3d12/crates/leonida-gpu/src/shown.rs) creates an unnamed auto-reset event viaCreateEventW(None, false, false, None)and returns on channel close orHOOK.get()Nonewithout closing theHANDLE.Fix
HANDLEinEventHandle, closing it viaCloseHandleand clearingself.0onDrop.shown::tests::event_handle_drop_closes_event_handleverifying in an isolated--exactsubprocess (GetHandleInformation) that droppingEventHandlecloses the OS handle.Verification
CloseHandlestubbed inEventHandle::drop,shown::tests::event_handle_drop_closes_event_handlefails (RED_SHOWN_EXIT=101); withDropactive,shown::testspasses (1 passed, 0 failed).cargo test --locked -p leonida-gpu --lib -- shown::tests) compiles cleanly.python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: exit 0.python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/shown.rs: exit 0.AI-assisted